package com.ganzalang.gmall.designchain.factory;

import com.ganzalang.gmall.designchain.service.VacationHandler;
import com.ganzalang.gmall.designchain.service.impl.DepartmenterVacationHandler;
import com.ganzalang.gmall.designchain.service.impl.GrouperVacationHandler;
import com.ganzalang.gmall.designchain.service.impl.ManagerVacationHandler;

/**
 * @description: VacationHandler的工厂
 * @author: Ganzalang
 * @Date 2021/5/7 14:51
 */
public class VacationHandlerFactory {

    /**
     * 定制VacationHandler的工厂方法
     * @return
     */
    public static VacationHandler createVacationHandler() {
        GrouperVacationHandler grouper = new GrouperVacationHandler();
        DepartmenterVacationHandler departmenter = new DepartmenterVacationHandler();
        ManagerVacationHandler manager = new ManagerVacationHandler();
        grouper.setNextHandler(departmenter);
        departmenter.setNextHandler(manager);

        return grouper;
    }
}
